export default {
  name: 'router-link',
  props: {
    to: {
      type: String,
      required: true,
    },
    tag: {
      type: String,
      default: 'a',
    },
  },
  render (h) {
    // jsx 或者 h 方法都可以
    let tag = this.tag;
    return (
      <tag
        onClick={() => {
          this.$router.push (this.to);
        }}
      >
        {this.$slots.default}
      </tag>
    );
    // return h (this.tag, this.$slot.default);
  },
};
